<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div id="roleEditModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true" >
	<div class="modal-dialog modal-lg">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
				<h4 class="modal-title">
					<i class="mark"></i> 
					<span>修改角色</span>
				</h4>
			</div>
			<div class="modal-body">
				<div class="row" ng-show="showname">
					<form class="form-horizontal">
						<div class="form-group">
							<label class="col-md-2 control-label">角色名称:</label>
							<div class="col-md-5">
								<input type="text"  class="form-control input-sm"  ng-model="submitRole.roleName" required placeholder="">
							</div>
						</div>
					</form>
				</div>
				<div class="row" ng-show="showuser">
					<div class="col-md-8">
						<div class="panel panel-primary">
							<div class="panel-body">
								<div class="row">
									<div class="col-md-5">
										<div jstree 
											tree-config="orgTreeConfig.config" 						
											tree-status="orgTreeConfig.status" 						
											tree-multiple="orgTreeConfig.multiple" 					
											tree-animation="orgTreeConfig.animation" 					
											tree-events="select_node:orgTreeConfig.events.selectNode"  
											tree-data="orgTreeConfig.data" 							
											tree-selected="orgTreeConfig.selected" 					
											tree-types="orgTreeConfig.types" 							
											tree-plugins="orgTreeConfig.plugins" 						
											tree-icons="orgTreeConfig.icons"
											tree-search="orgTreeConfig.search"></div>
									</div>
									
									<div class="table-responsive col-md-7">
										<table id="userRoleSelectTable" 
											data-id-field="id"
											data-side-pagination="server"
											data-row-style="rowStyle" 
											data-pagination="true"
											data-page-size="5" 
											data-click-to-select="true"
											data-query-params-type="" 
											data-page-list="[5, 10, 20]">
											<thead>
												<tr>
													<th data-checkbox='true'/>
													<th data-field="userName">员工姓名</th>
												</tr>
											</thead>
										</table>
									</div>	
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-1">
				 		 <div class="row" style="padding-bottom: 5px;">
						 	<button type="button" class="btn btn-success" id="addUser" ng-click="addUser()">添加</button>
						 </div>
						 <div class="row">
							 <button type="button" class="btn btn-danger" id="deleteUser" ng-click="deleteUser()">删除</button>
						 </div>
					</div>
					<div class="col-md-3">
						<div class="panel panel-primary">
							<div class="panel-body">
								<ul class="list-group">
									<li class="list-group-item" ng-repeat="x in selectedUsers">
										<span class="checkbox"> 
											<label><input type="checkbox" ng-model="x.xxx"> {{x.userName}}</label>
										</span>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row" ng-show="showprivilege">
					<div class="col-md-8">
						<div class="panel panel-primary">
							<div class="panel-body">
								<div class="row">
									<div class="col-md-5">
										<div jstree 
											tree-config="privTreeConfig.config"
											tree-status="privTreeConfig.status"
											tree-multiple="privTreeConfig.multiple"
											tree-animation="privTreeConfig.animation"
											tree-events="select_node:privTreeConfig.events.selectNode"
											tree-data="privTreeConfig.data"
											tree-selected="privTreeConfig.selected"
											tree-types="privTreeConfig.types"
											tree-plugins="privTreeConfig.plugins"
											tree-icons="privTreeConfig.icons"
											tree-search="privTreeConfig.search"></div>
									</div>

									<div class="table-responsive col-md-7">
										<table id="rolePrivSelectTable" 
											data-id-field="id"
											data-side-pagination="server"
											data-row-style="rowStyle" 
											data-pagination="true"
											data-page-size="5" 
											data-query-params-type="">
											<thead>
												<tr>
													<th data-checkbox='true' />
													<th data-field="privilegeName">权限名称</th>
												</tr>
											</thead>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-sm-1">
						<div class="row" style="padding-bottom: 5px;">
							<button type="button" class="btn btn-success" ng-click="addPrivilege()">添加</button>
						</div>
						<div class="row">
							<button type="button" class="btn btn-danger" ng-click="deletePrivilege()">删除</button>
						</div>
					</div>
					<div class="col-sm-3">
						<div class="panel panel-primary">
							<div class="panel-body">
								<ul class="list-group">
									<li class="list-group-item" style="padding: 0px 15px;" ng-repeat="x in selectedPrivileges">
										<span class="checkbox"> 
											<label><input type="checkbox" ng-model="x.xxx">{{x.privilegeName}}</label>
										</span>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<div class="modal-footer-button">
					<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
					<button type="submit" class="btn btn-sm btn-blue" ng-click="saveRole()">确认</button>
				</div>
			</div>
		</div>
	</div>
</div>